package com.kede.api.order.controller;

import com.kede.api.order.pojo.ZhiMoneyOrderPO;
import com.kede.api.order.service.IZhiOrderService;
import com.kede.pojo.ResHttp;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author:Pr.li
 * @Date: create in 2023/7/10 23:00
 */
@RequestMapping("order/zhi/money")
@RestController
public class ZhiMoneyController {


    @Resource
    private IZhiOrderService iZhiOrderService;

    /**
     * 创建现金置换订单
     * @param zhiMoneyOrderPO
     * @return
     */
    @PostMapping("addZhiMoneyOrder")
    public ResHttp addZhiMoneyOrder(@RequestBody @Validated ZhiMoneyOrderPO zhiMoneyOrderPO){
        return iZhiOrderService.addZhiMoneyOrder(zhiMoneyOrderPO);
    }

    /**
     * 门店确认现金置换
     * @param goodId
     * @return
     */
    @GetMapping("storeConfirm")
    public ResHttp storeConfirm(Integer goodId){
        return iZhiOrderService.storeConfirm(goodId);
    }

}
